Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
react web3 parse and store a transaction [receipt value] from returnValues

I have a minting Dapp in progress using Hashlips github repo. I've succesfully minted using the dapp and after the mint transaction is complete, I send the transaction receipt into the console log.

Inside the transaction receipt we have the events > transfer > returnValues. I want to read a specific return value and store that so I can use this value in another function.

Essentially inside returnValues I have stored a tokenID:'xnumberhere' and I need to use that for putting together images which I'll upload to IPFS.

How do I parse through receipt to save specific object data such as TokenID or even a parent such as blockNumber / blockHash

Current functions - see line 23/24 for logging the receipt

See this image of the console log where I want to retrieve tokenID

const claimNFTs = () => {
    let cost = CONFIG.WEI_COST;
    let gasLimit = CONFIG.GAS_LIMIT;
    let totalCostWei = String(cost * mintAmount);
    let totalGasLimit = String(gasLimit * mintAmount);
    console.log("Cost: ", totalCostWei);
    console.log("Gas limit: ", totalGasLimit);
    setFeedback(`Minting your ${CONFIG.NFT_NAME}...`);
    setClaimingNft(true);
    blockchain.smartContract.methods
      .mintNFT(mintAmount)
      .send({
        gasLimit: String(totalGasLimit),
        to: CONFIG.CONTRACT_ADDRESS,
        from: blockchain.account,
        value: totalCostWei,
      })
      .once("error", (err) => {
        console.log(err);
        setFeedback("Sorry, something went wrong please try again later.");
        setClaimingNft(false);
      })
      .then((receipt) => {
        console.log(receipt);
        setFeedback(
          `WOW, the ${CONFIG.NFT_NAME} is yours! go visit Opensea.io to view it.`
        );
        setClaimingNft(false);
        dispatch(fetchData(blockchain.account));
        getData();
      });
  };

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To retrieve the events response of my Mint transaction, I used the following:

var tokenId = receipt.events.Transfer.returnValues.tokenId
        console.log("Your NFT ID is: " + receipt.events.Transfer.returnValues.tokenId); 

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!